home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HAM Radio 3.2
/
Ham Radio Version 3.2 (Chestnut CD-ROMs)(1993).ISO
/
swl
/
propplus
/
propplus.bas
next >
Wrap
BASIC Source File
|
1987-07-19
|
14KB
|
309 lines
1 rem Propogation Aid program combining various components into one
2 rem hopefully useful program. Currently gives about the same
3 rem muf as the narc program over comparable paths, but the luf
4 rem seems to be larger by a factor of 2 for high frequencies on this
5 rem path. The LUF produce by this program is too high by my observation.
6 rem Additions could include a search of openings (MUF > LUF) by time,
7 rem input of targets from external files, and a more sophisticated
8 rem definition of grayline.
9 rem Eric J. Johnson, 19 July 1987
10 rem Components included MICROMUF, provided by Radio Nederland,
11 rem Minimuf Version 4.1 tuned by N6BV, which is the source of the front-end
12 rem albeit modified, and a sunrise/sunset calculation program, author at
13 rem present unknown.
14 rem
15 rem Comments, etc. to
16 rem Eric J. Johnson
17 rem 1728 Rodman St.
18 rem Philadelphia, PA 19146-1527
19 rem [215]-732-7982
20 rem johnson00@wharton.upenn.edu- Internet
21 rem 76010,3375 Compuserve
24 rem ______________________________________________________________________
25 A=100:REM 'MICROMUF'
26 radian = 57.295780
27 DIM DAYPART(12),T$(40),R$(40),A$(40),I$(40)
30 P=4*ATN(1):REM EASY PI
35 RD=P/180:D=180/P
40 I$="Invalid, please try again..."
50 PRINT "MICROMUF FURNISHED BY RADIO NETHERLANDS"
60 PRINT "This program calculates the"
70 PRINT "*M.U.F(Maximum Usable Frequency)"
80 PRINT "*L.U.F(Lowest Usable Frequency)"
90 PRINT "Calculations are done for any month and Solar level."
100 PRINT
103 rem Input "Do you wish to write the path onto the mapper database [Y,N]?",pathmap$
104 if pathmap$ = "Y" then open "database" for append as 1
108 Input "Do you wish to write openings to disk [Y,N]?",mufwrite$
109 if mufwrite$ = "Y" then open "muf.dat" for output as 2
110 PRINT "Reciever Location";:INPUT T$
111 PRINT :PRINT "Reciever Longitude":PRINT "In degrees(W=+/E=-)";:INPUT YT
112 IF YR<-180 OR YR>180 THEN PRINT I$:GOTO 520
113 PRINT :PRINT "Reciever Latitude":PRINT "In degrees(N=+/S=-)";:INPUT XT
115 PRINT "Your Location is ",T$
120 PRINT :PRINT "Longitude :",YT," Latitude: ",XT
130 PRINT "Number of month,day";:INPUT M,DA
140 IF M<1 OR M>12 THEN PRINT I$:GOTO 130:REM SUN SPOT DATA
150 PRINT :INPUT "State Source of Solar Activity - S= Sunspot # F= Solar Flux: ",AN1$
160 IF AN1$="S" OR AN1$="s" THEN 240 ELSE IF AN1$="F" OR AN1$="f" THEN 170 ELSE 150
170 INPUT "Smoothed Mean 10.7cm Solar Flux: ",SF
180 IF SF<65 THEN PRINT "Invalid Flux Number, Must Be Greater Than 65.":GOTO 170
190 IF SF>245 THEN PRINT "Results May Be Inaccurate for Flux Greater Than 245."
200 R=-103.7767+1.797429*SF-(3.384356E-03)*SF^2+(4.525515E-06)*SF^3
210 R=INT(100*R+.5)/100
220 PRINT "A Flux of";SF;"Equates to a Sunspot Number of";R
230 FOR X=1 TO 2000:NEXT X:GOTO 260
240 PRINT :INPUT "3-Day Smoothed International Sunspot Number: ",R
250 IF R<=0 THEN PRINT "Invalid Sunspot Number. Must Be Non-Negative.":GOTO 240
260 CLS: PRINT "Path Options":PRINT
270 PRINT 1,CS$;" To E.Coast USA (Washington, D.C.)"
280 PRINT 2,CS$;" To South America (Asencion, Paraguay)"
290 PRINT 3,CS$;" To the Caribean (Bonaire)"
300 PRINT 4,CS$;" To Polynesia (Papua-New Guinea)"
310 PRINT 5,CS$;" To Japan (Tokyo)"
320 PRINT 6,CS$;" To Australia (Melbourne)"
330 PRINT 7,CS$;" To S.Asia (Bangkok, Thailand)"
340 PRINT 8,CS$;" To Central Asia (New Delhi, India)"
350 PRINT 9,CS$;" To W.Europe (London, England)"
360 PRINT 10,CS$;" To E.Europe (Kiev, Ukraine)"
370 PRINT 11,CS$;" To USSR (Moscow)"
380 PRINT 12,CS$;" To the Middle East (Jerusalam)"
390 PRINT 13,CS$;" To W.Coast Africa (Lagos)"
400 PRINT 14,CS$;" To E. Coast Africa (Nairobi, Kenya)"
410 PRINT 15,CS$;" To S. Africa (Lusaka, Zambia)"
420 PRINT 16,CS$;" To a Specified Point"
430 PRINT 17," Respecify Month, Flux":PRINT 18," Exit Program"
440 PRINT: INPUT " Your Choice: ",CH
450 P=4*ATN(1):REM EASY PI
460 IF CH<1 OR CH>19 THEN CLS:LOCATE 12,30:PRINT "Bad Choice Number":FOR X=1 TO 2000:NEXT X:CLS:GOTO 260
480 IF CH=18 THEN CLS: SYSTEM
490 IF CH=17 THEN CLS: GOTO 110
495 if ch=19 then loop=1: goto 570
500 if CH < 16 THEN GOTO 570
510 PRINT "Transmitter Location";:INPUT R$
520 PRINT :PRINT "Transmitter Longitude":PRINT "In degrees(W=+/E=-)";:INPUT YR
530 IF YR<-180 OR YR>180 THEN PRINT I$:GOTO 520
540 PRINT :PRINT "Transmitter Latitude":PRINT "In degrees(N=+/S=-)";:INPUT XR
550 IF XR>90 OR XR<-90 THEN PRINT I$:GOTO 550
560 GOTO 730
570 if loop = 1 then for ch = 1 to 15
573 RD=P/180:D=180/P
575 IF CH=1 THEN XR=38:YR=75:R$="To E.Coast USA (Wash.D.C.) ":GOTO 730
580 IF CH=2 THEN XR=-25.3:YR=58:R$="To South America (Asuncion, Paraguay)":GOTO 730
590 IF CH=3 THEN XR=12:YR=68.19:R$="To Carribean (Bonaire) ":GOTO 730
600 IF CH=4 THEN XR=-10:YR=-145:R$="To Polynesia (Papau-New Guinea) ":GOTO 730
610 IF CH=5 THEN XR=36:YR=-140:R$="To Japan (Tokyo) ":GOTO 730
620 IF CH=6 THEN XR=-38:YR=-145:R$="To Australia (Melbourne) ":GOTO 730
630 IF CH=7 THEN XR=14:YR=-102:R$="To S.Asia (Bangkok, Thailand) ":GOTO 730
640 IF CH=8 THEN XR=28:YR=-77:R$="To Central Asia (New Delhi, India) ":GOTO 730
650 IF CH=9 THEN XR=51.5:YR=-.1:R$="To W.Europe (London, England) ":GOTO 730
660 IF CH=10 THEN XR=50.5:YR=-31:R$="To E.Europe (Kiev, Ukraine) ":GOTO 730
670 IF CH=11 THEN XR=56:YR=-38:R$="To the USSR (Moscow) ":GOTO 730
680 IF CH=12 THEN XR=31.2:YR=-40:R$="To the Middle East (Jerusalem) ":GOTO 730
690 IF CH=13 THEN XR=3.56:YR=-7.23:R$="To W.Coast Africa (Lagos) ":GOTO 730
700 IF CH=14 THEN XR=-2:YR=-37:R$="To E.Coast Africa (Kenya) ":GOTO 730
710 IF CH=15 THEN XR=-15:YR=-28:R$="To S.Africa (Lusaka, Zambia) ":GOTO 730
720 IF CH=16 THEN R$="To Transmitter ": PRINT CS$+" To a Transmitter Point"
730 CLS
733 RD=P/180:D=180/P
735 if pathmap$ = "Y" then write #1,yr/radian,xr/radian: write #1,yt/radian,xt/radian:print#1,"0,0"
736 rem sunline goes here....write #1,
740 REM GEOMETRY CALC.
750 N=0
760 Q=SIN(XT*RD)*SIN(XR*RD)
770 X=Q+COS(XT*RD)*COS(XR*RD)*COS(YT*RD-YR*RD)
780 LA=-ATN(X/SQR(-X*X+1+1E-12))+(P/2):LA=LA*D
790 L=111.1*LA
800 Q=(SIN(XR*RD)-SIN(XT*RD)*COS(LA*RD))
810 X=Q/COS(XT*RD)/SIN(LA*RD)
820 U=-ATN(X/SQR(-X*X+1+1E-12))+(P/2):U=U*D
830 IF YT<=0 THEN U=360-U
840 IF ABS(YT-YR)>=180 THEN U=360-U
850 H=275+R/2
860 XS=23.4*COS(30*(M-6.25)*RD)
870 N=N+1
880 LH=L/N
890 IF LH>4500 THEN 870
900 LM=LA/N
910 A=ATN((COS(.5*LM*RD)-6367/(H+6367))/SIN(.5*LM*RD))
920 A=A*D
930 IF A<1.5 THEN 870
940 PRINT "From ";T$;" ";R$
950 PRINT "Month ";M;" Day ";DA;
960 PRINT "SSN:";R;" Dist. ";INT(L*.6215+.5);" miles":REM L=KILOMETERS
970 PRINT "Azim ";INT(U+.5);" degr. F-Hops:";N
980 PRINT "__________________________ Mhz"
990 FOR Q=34 TO 2 STEP -2
1000 IF Q > 2 THEN PRINT "| | ";Q
1010 IF Q = 2 THEN PRINT "|________________________| ";Q
1020 NEXT Q
1030 PRINT " 0 2 4 6 8 1 1 1 1 1 2 2 H(UTC)"
1040 PRINT " 0 2 4 6 8 0 2 +:MUF -:LUF"
1050 VE=5:HO=30:LOCATE VE,HO:
1060 FOR T=0 TO 23
1070 LS=0:AB=0
1080 K=.5:GOSUB 1270:GOSUB 1390:MF=FF:rem looks like it examines only
1085 rem first and last skips (ejj)
1090 K=N-.5:GOSUB 1270:GOSUB 1390
1100 IF FF<MF THEN MF=FF
1110 VE=22-INT(MF/2+.5):HO=T+1
1120 IF VE<5 THEN VE=5
1130 LOCATE VE,HO+1
1140 PRINT "+"
1150 FOR K=.25 TO N-.25 STEP .5
1160 GOSUB 1270
1170 GOSUB 1650
1180 AB=AB+LS
1190 NEXT K
1200 VE=22-INT(AB+.5)
1210 IF VE<5 THEN VE=5
1220 IF VE>21 THEN VE=21
1230 LOCATE VE,HO+1
1240 IF VE < 21 THEN PRINT "-"
1245 IF VE=21 THEN PRINT "_"
1246 luf = 2.0*ab
1248 if (mufwrite$ = "Y") and (luf < mf) then write #2,t,mf,luf,R$
1250 NEXT T
1260 LOCATE 22,27:GOTO 1770
1270 REM INTERM. LAT.&LONG.
1280 Q=COS(U*RD)*COS(XT*RD)*SIN(K*LM*RD)
1290 X=Q+SIN(XT*RD)*COS(K*LM*RD)
1300 XN=ATN(X/SQR(-X*X+1+1E-12)):XN=XN*D
1310 Q=(COS(K*LM*RD)-SIN(XT*RD)*SIN(XN*RD))
1320 X=Q/(COS(XT*RD)*COS(XN*RD))
1330 YI=-ATN(X/SQR(-X*X+1+1E-12))+(P/2):YI=YI*D
1340 IF U<180 THEN YI=-YI
1350 YN=YT+YI
1360 IF YN>180 THEN YN=YN-360
1370 IF YN<-180 THEN YN=YN+360
1380 RETURN
1390 YZ=YN:REM MINI F2 F-LAYER CALC
1400 IF YN<-160 THEN YZ=YN+360
1410 YG=(20-YZ)/50
1420 ZO=20*YG/(1+YG+YG^2)+5*(1-YG/7)^2
1430 Z=XN-ZO
1440 TL=T-YN/15
1450 IF TL>24 THEN TL=TL-24
1460 IF TL<0 THEN TL=TL+24
1470 MH=M
1480 REM TRAP 1440
1490 IF Z>0 THEN 1520
1500 Z=-Z
1510 MH=M+6
1520 XH=COS(30*(MH-6.5)*RD):REM 1 WEEK DELAY AT EQUINOXES
1530 SX=(ABS(XH)+XH)/2:REM F LAYER SUMMER VAR.
1540 WX=(ABS(XH)-XH)/2:REM F LAYER WINTER VAR.
1550 IF Z>77.5 THEN Z=77.5
1560 TY=TL
1570 IF TY<5 THEN TY=TL+24
1580 YF=(TY-14-SX*2+WX*2-R/175)*(7-SX*3+WX*4-R/(150-WX*75))
1590 IF ABS(YF)>60 THEN YF=60
1600 X=(1+R/(175+SX*175))
1610 FO=6.5*X*COS(YF*RD)*COS((Z-SX*5+WX*5)*RD)^.5
1620 SF=(1-(COS(A*RD)*6367/(6367+H))^2)^-.5
1630 FF=FO*SF:REM MUF AT CONTROL POINT
1640 RETURN
1650 REM E-LAYER & ABSORTION CALC.
1660 Q=SIN(XN*RD)*SIN(XS*RD)
1670 X=Q+COS(XN*RD)*COS(XS*RD)*COS((YN-15*(T-12))*RD)
1680 XZ=(-ATN(X/SQR(-X*X+1+1E-12))+P/2)*D
1690 IF XZ>85 THEN 1720
1700 FE=3.4*(1+.0016*R)*COS(XZ*RD)^.3
1710 GOTO 1730
1720 FE=3.4*(1+.0016*R)*(XZ-80)^-.5
1730 SE=(1-.965*COS(A*RD)^2)^-.5
1740 RE=1/(FE*SE)
1750 LS=.028*FE^2*SE
1760 RETURN
1770 LOCATE 3,40: PRINT "Sunset, Sunrise for ",T$,":"
1780 D1=XT:D2=YT: TIMES=1: GOSUB 1880
1790 LOCATE 12,40: PRINT "Sunset, Sunrise for Transmitter:"
1800 D1=XR:D2=YR:TIMES=10:FIRST=1:GOSUB 1880
1802 if (rgmrise = -1 and rgmset = -1) then goto 1860
1805 if(yr<yt) then rgmrise=rgmrise+24:rem correction for sunrise the next day
1806 if (yr>yt)then tgmrise=tgmrise+24:rem correction for sunrise the next day
1810 IF (RGMSET < TGMRISE) THEN LOCATE 10+TIMES,40:PRINT "Darkness path exists to the west"
1812 IF (RGMRISE > TGMSET) THEN LOCATE 11+TIMES,40:PRINT "Darkness path exists to the east"
1830 GRAYLINE = .75:GRAYSUN1=ABS(TGMRISE-RGMRISE):GRAYSUN2=ABS(TGMRISE-RGMSET)
1835 if (graysun1 > (24-grayline)) then graysun1 = graysun1 - 24
1840 IF ((GRAYSUN1) < GRAYLINE)THEN LOCATE 12+TIMES,40:PRINT USING "Sameside grayline at sunrise: ## minutes";(GRAYSUN1)*60
1842 IF (GRAYSUN2<GRAYLINE) THEN LOCATE 12+TIMES,40:PRINT USING "Farside grayline at sunrise: ## minutes";GRAYSUN2*60
1845 GRAYSUN1=ABS(TGMSET-RGMRISE):GRAYSUN2=ABS(TGMSET-RGMSET)
1846 IF (GRAYSUN2 < GRAYLINE)THEN LOCATE 13+TIMES,40:PRINT USING "Sameside grayline at sunset: ## minutes";GRAYSUN2*60;
1847 IF (GRAYSUN1<GRAYLINE) THEN LOCATE 13+TIMES,40:PRINT USING "Farside grayline at sunset: ## minutes";GRAYSUN1*60
1860 if loop = 0 then LOCATE 25,1:INPUT "Computations Completed, press enter for menu.", PAUSE: GOTO 260
1865 next ch
1870 if pathmap > 0 then print #1, "0,0":print #1, "0,0"
1872 :close #1:close #2:END
1880 REM Sunset,Sunrise calculation code.
1890 LA=0:X=0:PL=0:TD=0:LO=0:E=0:D=0:GM=0:T1=0:T2=0:T3=0:CNT=0:
1900 PL=3.14159/26:J=57.2958
1910 GOSUB 2510
1920 LA = D1
1930 LONG=D2
1940 IF LA < 0 THEN LA = LA + 180
1950 IF D2 < 0 THEN D2 = D2 + 360
1960 LO = FIX(D2/15)*15 :REM finds time zone beginning
1970 TD=(D2-LO)/15:IF FIRST > 0 THEN GOTO 2010: REM skip initialization
1980 FOR I=1 TO 12: READ DAYPART(I):NEXT I
1990 DATA 0,31,59,90,120,151
2000 DATA 181,212,243,273,304,334
2010 X=(DAYPART(M)+DA)/7
2020 REM
2030 D=.4560001-22.195*COS(PL*X)-.43*COS(2*PL*X)-.156*COS(3*PL*X)+3.83*SIN(PL*X)+.06*SIN(2*PL*X)-.082*SIN(3*PL*X)
2040 REM
2050 IF TIMES = 1 THEN LOCATE 4+TIMES,40:PRINT"Declination Of Sun:";:PRINT USING"###.#";D;:PRINT" Degrees"
2060 LOCTIME=FIX(LONG/15)*-1:
2070 IF TIMES> 1 THEN LOCATE 4+TIMES,40: PRINT "Local time: ";LOCTIME;" UT"
2080 E=8.000001E-03+.51*COS(PL*X)-3.197*COS(2*PL*X)-.106*COS(3*PL*X)-.15*COS(4*PL*X)-7.317001*SIN(PL*X)-9.471001*SIN(2*PL*X)-.391*SIN(3*PL*X)
2090 REM
2100 if times = 1 then LOCATE 5+TIMES,40:PRINT"Equation Of Time:";:PRINT USING"###.#";E;:PRINT" minutes"
2130 CL=COS(LA/J):SD=SIN(D/J):CD=COS(D/J):Y=SD/CL
2140 IF ABS(Y)=>1 THEN LOCATE 6+TIMES,40: PRINT"No sunrise or sunset":rgmrise=-1:tgmrise=-1:rgmset=-1:tgmset=-1:RETURN
2150 Z = 90 - J*ATN(Y/SQR(1-Y*Y))
2160 LOCATE 6+TIMES,40:PRINT"Azimuth of sunrise:";
2170 PRINT USING"####.#";ABS(Z);
2180 PRINT" degrees"
2190 LOCATE 7+TIMES,40: PRINT"Azimuth of sunset: ";
2200 PRINT USING"####.#";360-ABS(Z);
2210 PRINT" degrees"
2220 ST=SIN(Z/J)/CD
2230 IF ABS(ST)>=1 THEN T3=6:TT=6:GOTO 2270
2240 CT=SQR(1-ST*ST)
2250 T3=J/15*ATN(ST/CT)
2260 TT=T3
2270 IF D<0 AND LA<90 THEN T3=12-T3:TT=T3
2280 IF D>0 AND LA>90 THEN T3=12-T3: TT=T3
2290 T3=T3+TD-E/60-.04
2300 GOSUB 2410
2310 LOCATE 8+TIMES,40:PRINT"Time Of Sunrise:";T1$;":";T2$;" ";T3$;"L.T. ";GM$;":";T2$;" UT"
2320 IF TIMES=1 THEN TGMRISE=t1+(T2/60)-loctime
2330 IF TIMES > 1 THEN RGMRISE=t1+(T2/60)-loctime
2340 T3=12-TT:T3=T3+TD-E/60+.04
2350 CNT=1
2360 GOSUB 2410
2370 LOCATE 9+TIMES,40 :PRINT"Time Of Sunset: ";T1$;":";T2$;" ";T3$;"L.T. ";GM$;":";T2$;" UT"
2380 IF TIMES=1 THEN TGMSET=t1+12+(T2/60)-loctime
2390 IF TIMES > 1 THEN RGMSET=t1+12+(T2/60)-loctime
2400 RETURN
2410 T1=INT(T3):T2=T3-T1:T1$=STR$(T1):T2=INT((T2*600+5)/10)
2415 if t2 > 59 then t2 = t2-1
2420 T2$=STR$(T2):T2$=RIGHT$(T2$,LEN(T2$)-1)
2430 IF INT(T2)<10 THEN T2$="0"+T2$
2440 GM = FIX(D2/15) :REM calculate difference between GM and local time
2450 IF CNT = 0 THEN GM = VAL(T1$)-loctime :REM GMT for sunrise
2460 IF CNT > 0 THEN GM = VAL(T1$)+12-loctime :REM GMT for sunset
2480 IF (GM > 23 and loctime > 0) THEN GM = GM - 23
2485 if (gm >23 and Loctime <= 0) then gm = gm-24
2488 if (gm < 0) then gm=gm+24
2490 GM$ = STR$(GM) :GM$ = RIGHT$("0"+GM$,2)
2500 RETURN
2510 REM This subroutine converts DD.MM input to DD.DD
2520 DEGTMP = (ABS(D1)-ABS(FIX(D1))) *100/60
2530 D1 = (FIX(ABS(D1))+DEGTMP)*SGN(D1)
2540 DEGTMP = (ABS(D2)-ABS(FIX(D2))) *100/60
2550 D2 = (FIX(ABS(D2))+DEGTMP)*SGN(D2)
2560 RETURN
(ABS(D1))+DEGTMP)*SGN(D1)
2540 DEGTMP = (ABS(D2)-ABS(FIX(D2)